<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="../js/vue.js" type="text/javascript" charset="utf-8"></script>
		<style type="text/css">
			.active{
				color: red;
			}
		</style>
	</head>
	<body>
		<div id="app">
			<h2 class="active">{{message}}</h2>
			<h2 :class="active">{{message}}</h2>
			<h2 v-bind:class="{active: isactive, line: isline}">{{message}}</h2>
			<h2 v-bind:class="getClasses()">{{message}}</h2>
			<button type="button" @click="btnClick">点击</button>
		</div>
	</body>
	<script type="text/javascript">
		const app = new Vue({
			el:'#app',
			data:{
				message:'你好',
				active:'active',
				isactive:true,
				isline:true
			},
			methods:{
				btnClick:function(){
					this.isactive = !this.isactive;
				},
				getClasses:function(){
					return {active: this.isactive, line: this.isline}
				}
			}
		})
	</script>
</html>
